﻿#!/usr/bin/env python3

import socket

def main():
    '''echo client -  copy from python help doc'''
    print(main.__doc__)
    print("="*30)

    HOST = 'localhost'    # The remote host
    PORT = 50007              # The same port as used by the server
    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        s.connect((HOST, PORT))
        s.sendall(b'Hello, world')
        data = s.recv(1024)
    print('Received', repr(data))

if __name__=='__main__':
    main()
